import http from '@/utils/requset'
import { UserType } from '@/types/user'
//params data
//登录
export const Login = (data: UserType) => {
	return http.request({
		url: '/common/login',
		method: 'POST',
		data
	})
}
//注册
export const Logon = (data: UserType) => {
	return http.request({
		url: '/common/logon',
		method: 'POST',
		data
	})
}
//获取用户信息
export const getUserInfo = (params?: any) => {
	return http.request({
		url: `/user/userInfo`,
		method: 'GET',
		params
	})
}
//获取用户信息
export const getUsersList = (params?: any) => {
	return http.request({
		url: `/user/getUsersList`,
		method: 'GET',
		params
	})
}
//更新用户信息
export const updataUserInfo = (data?: any) => {
	return http.request({
		url: `/user/updataUserInfo`,
		method: 'POST',
		data
	})
}
export const logOff = (data?: any) => {
	return http.request({
		url: `/common/logOff`,
		method: 'DELETE',
		data
	})
}